package org.langke.design.pattern.strategy;

/**
 * 支付方式枚举
 */
public enum PaymentEnum {
    ALI_PAY("ALI_PAY",new AliPayStrategy()),
    WECHAT_PAY("WECHAT_PAY",new WechatPayStrategy()),
    UNION_PAY("UNION_PAY",new UnionPayStrategy()),
    DEFAULT("DEFAULT",new JDPayStrategy());

    private final String payName;
    private final PaymentStrategy paymentStrategy;

    PaymentEnum(String payName,PaymentStrategy paymentStrategy){
        this.payName = payName;
        this.paymentStrategy = paymentStrategy;
    }
    public String getPayName(){
        return payName;
    }
    public PaymentStrategy getPaymentStrategy(){
        return paymentStrategy;
    }
}
